package com.cn.dream_order_server.pojo;

import org.springframework.data.annotation.Transient;

import java.util.Date;

public class GoodCommoditySku {
    private String commodityId;//商品id

    private Long spuId;//spu_id

    private String title;//商品标题

    private String images;//商品的图片，多个图片以‘,’分割

    private Long price;//销售价格，单位为分

    private String indexes;//特有规格属性在spu属性模板中的对应下标组合

    private String ownSpec;//sku的特有规格参数键值对，json格式，反序列化时请使用linkedHashMap，保证有序

    private Boolean enable;//是否有效，0无效，1有效

    private Date createTime;//添加时间

    private Date lastUpdateTime;//最后修改时间

    @Transient
    private Long stock;


    public String getCommodityId() {
        return commodityId;
    }

    public void setCommodityId(String commodityId) {
        this.commodityId = commodityId == null ? null : commodityId.trim();
    }

    public Long getSpuId() {
        return spuId;
    }

    public void setSpuId(Long spuId) {
        this.spuId = spuId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images == null ? null : images.trim();
    }

    public Long getPrice() {
        return price;
    }

    public void setPrice(Long price) {
        this.price = price;
    }

    public String getIndexes() {
        return indexes;
    }

    public void setIndexes(String indexes) {
        this.indexes = indexes == null ? null : indexes.trim();
    }

    public String getOwnSpec() {
        return ownSpec;
    }

    public void setOwnSpec(String ownSpec) {
        this.ownSpec = ownSpec == null ? null : ownSpec.trim();
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public GoodCommoditySku(String commodityId, Long spuId, String title, String images, Long price, String indexes, String ownSpec, Boolean enable) {
        this.commodityId = commodityId;
        this.spuId = spuId;
        this.title = title;
        this.images = images;
        this.price = price;
        this.indexes = indexes;
        this.ownSpec = ownSpec;
        this.enable = enable;
    }

    public GoodCommoditySku() {
    }
}